<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>组件参数校验与非props特性</title>
  <script src="../static/vue.js"></script>
</head>
<body>
<div id="root">
  <child :coutent="{name:11}"></child>
</div>

<script>
  Vue.component('child', {
    props: {
      coutent: {
        type: String,
        required: true,
        default: 'default value',
        validator: function (value) {
          return value.length > 5
        }
      },
      // coutent: [String,Number],
    },
    template: '<div>{{coutent}}</div>'
  })

  var vm = new Vue({
    el: '#root'
  })
</script>
</body>
</html>
